package com.bawei.park2302.user


import com.bawei.lib_base.utils.utils.mvi.BaseViewModel
import com.bawei.lib_base.utils.utils.utils.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class UserViewModel @Inject constructor(val apiService: ApiService) : BaseViewModel<UserIntent>(){
    override fun handelIntent(it: UserIntent) {
        when(it){
            is UserIntent.register->httpRequest(apiService.register(it.username,it.password))

            is UserIntent.login->httpRequest(apiService.login(it.username,it.password))
        }
    }
}